package com.example.attempt.service.impl;

import com.example.attempt.entity.Assistant;
import com.example.attempt.mapper.AssistantMapper;
import com.example.attempt.service.AssistantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssistantServiceImpl implements AssistantService {
    @Autowired
    AssistantMapper assistantMapper;

    @Override
    public List<Assistant> queryAll(){return assistantMapper.queryAll();}

    @Override
    //添加数据
    public int addAssistant(Assistant assistant){
        assistantMapper.addAssistant(assistant);
        return 0;
    }

    @Override
    //根据用户名查询数据
    public Assistant queryById(String aid){
        return assistantMapper.queryById(aid);
    }

    @Override
    public Assistant queryByTid(String tid){
        return assistantMapper.queryByTid(tid);
    }

    @Override
    public Assistant queryByIdAndP(String aid, String apwd){
        return assistantMapper.queryByIdAndP(aid, apwd);
    }

    @Override
    public int getNum(){
        return assistantMapper.getNum();
    }

    @Override
    public int deleteAssistant(String aid){
        assistantMapper.deleteAssistant(aid);
        return 0;
    }
}
